home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / util / blank / bserver_v14.lha / BServer_v1.4 / Sources.lha / Sources / clients / KillDMA.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-23  |  1.6 KB  |  72 lines

  1. ;/*
  2. sc RESOPT IGNORE=73 DATA=NEAR NMINC UCHAR CONSTLIB STREQ STRMERGE NOSTKCHK NOSTDIO OPTIMIZE OPTSIZE KillDMA.c
  3. slink from LIB:c.o KillDMA.o to //Clients/KillDMA LIB LIB:sc.lib LIB:amiga.lib /lib/client.lib SC SD STRIPDEBUG NOICONS
  4. delete KillDMA.o
  5. quit
  6.  
  7.  KillDMA 1.2  (Client for BServer)
  8.  
  9.  Copyright © 1994-1995 Stefano Reksten of 3AM - The Three Amigos!!!
  10.  All rights reserved.
  11. */
  12.  
  13. #include <exec/types.h>
  14. #include <exec/memory.h>
  15. #include <graphics/gfxmacros.h>
  16. #include <hardware/dmabits.h>
  17. #include <hardware/intbits.h>
  18.  
  19. #include <proto/exec.h>
  20. #include <proto/intuition.h>
  21. #include <proto/graphics.h>
  22.  
  23. #include "/include/client.h"
  24.  
  25. char *ver = "$VER: KillDMA 1.2 "__AMIGADATE__;
  26.  
  27. struct IntuitionBase *IntuitionBase;
  28. struct GfxBase *GfxBase;
  29. struct DisplayIDInformation *dinfo;
  30.  
  31. extern far struct Custom custom;
  32.  
  33. void Blank( void )
  34. {
  35. struct Screen *scr;
  36.  
  37. if ( scr = OpenScreenTags( NULL,
  38.     SA_Depth, 0,
  39.     SA_DisplayID, DISPLAYID( dinfo ),
  40.     TAG_END ) )
  41.     {
  42.     register struct ViewPort *vp = &(scr->ViewPort);
  43.  
  44.     SetRGB4( vp, 0, 0, 0, 0 );
  45.     WaitTOF();
  46.     custom.dmacon = BITCLR|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
  47.     WaitServerCommand();
  48.     custom.dmacon = BITSET|DMAF_AUDIO|DMAF_SPRITE|DMAF_COPPER|DMAF_RASTER;
  49.     CloseScreen( scr );
  50.     }
  51. else
  52.     SendClientMsg( ACTION_FAILED );
  53. }
  54.  
  55.  
  56. void __main( char *line )
  57. {
  58. if ( IntuitionBase = (struct IntuitionBase *)OpenLibrary( "intuition.library", 37L ) )
  59.     {
  60.     if ( GfxBase = (struct GfxBase *)OpenLibrary( "graphics.library", 37L ) )
  61.         {
  62.         if ( dinfo = OpenCommunication() )
  63.             {
  64.             Blank();
  65.             CloseCommunication( dinfo );
  66.             }
  67.         CloseLibrary( (struct Library *)GfxBase );
  68.         }
  69.     CloseLibrary( (struct Library *)IntuitionBase );
  70.     }
  71. }
  72.